import { reactive, toRef } from 'vue';
import router from '@/router';
import { sliceTime } from '@/utils/time';
export default function importConfig() {
  const base = reactive<any>({
    data: {},
    sendWorkTabel: [],
    dataList: []
  });
//   console.log(router.currentRoute.value.query)
  console.log()
  const localStorageData = localStorage.getItem("purchaseOrderDetailsData") || "";
  base.data = JSON.parse(localStorageData)
  console.log(base.data)
  // 信息嫁接
  const sendWorkOption = () => {
    base.sendWorkTabel = [];
    base.dataList = [base.data];
    base.sendWorkTabel = [
        {
            label: "采购部门",
            value: ""
        },
        {
            label: "部门名称",
            value: ""
        },
        {
            label: "采购单号",
            value: base.data.TC001 + "-" + base.data.TC002
        },
        {
            label: "采购人员",
            value: base.data.Tc011
        },
        {
            label: "采购日期",
            value: base.data.TC003
            // value: sliceTime(base.data.TC003).replaceAll(":","")
        },
        {
            label: "供应商编号",
            value: base.data.TC004
        },
        {
            label: "供应商名称",
            value: base.data.TC004
        },
        {
            label: "单据日期",
            value: base.data.TC024
        },
        {
            label: "交易币种",
            value: base.data.Tc005
        },
        {
            label: "汇率",
            value: base.data.TC006
            // value: sliceTime(base.data.TC003).replaceAll(":","")
        },
        {
            label: "税额",
            value: base.data.TD035
        },
        {
            label: "税前总金额",
            value: base.data.TD034
        },
        {
            label: "总金额",
            value: base.data.TC024
        },
        {
            label: "总数量",
            value: base.data.TD008
        },
        {
            label: "审核者",
            value: base.data.TC025
            // value: sliceTime(base.data.TC003).replaceAll(":","")
        },
        {
            label: "制造商",
            value: base.data.TD017
        },
        {
            label: "付款条件",
            value: base.data.TC008
        },
        {
            label: "收货地址",
            value: base.data.TC024
        },
        {
            label: "备注",
            value: base.data.TC009
        },
    ]
  }
  sendWorkOption();
  return {
    base
  };
}
